package com.ruiysoft.crm.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 客户信息表
 *
 * @author fyl
 * @date 2019-06-05 23:02:43
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Accessors(chain = true)
@TableName(value = "biz_client")
public class BizClient extends Model<BizClient> {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 客户姓名
     */
    @TableField(value = "client_name", exist = true)
    private String clientName;
    /**
     * 客户生日
     */
    @TableField(value = "birthday", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;
    /**
     * 客户邮箱
     */
    @TableField(value = "email", exist = true)
    private String email;
    /**
     * 通话备注
     */
    @TableField(value = "note", exist = false)
    private String note;
    /**
     * 客户证件号码
     */
    @TableField(value = "id_no", exist = true)
    private String idNo;
    /**
     * 客户性别
     */
    @TableField(value = "sex", exist = true)
    private String sex;
    /**
     * 客户手机号
     */
    @TableField(value = "mobile_phone", exist = true)
    private String mobilePhone;
    /**
     * 客户地址
     */
    @TableField(value = "address", exist = true)
    private String address;
    /**
     * 联系人
     */
    @TableField(value = "contacts", exist = true)
    private String contacts;
    /**
     * 跟进状态
     */
    @TableField(value = "follow_status", exist = true)
    private Integer followStatus;
    /**
     * 被保险人
     */
    @TableField(value = "insured", exist = true)
    private String insured;
    /**
     * 被保人身份证号
     */
    @TableField(value = "insured_id_card", exist = true)
    private String insuredIdCard;
    /**
     * 客户备用电话
     */
    @TableField(value = "standby_mobile", exist = true)
    private String standbyMobile;
    /**
     * 客户类别
     */
    @TableField(value = "client_type", exist = true)
    private String clientType;
    /**
     * 保险单出单日
     */
    @TableField(value = "create_policy_date", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate createPolicyDate;
    /**
     * 车牌号
     */
    @TableField(value = "car_no", exist = true)
    private String carNo;
    /**
     * 车架号
     */
    @TableField(value = "vehicle_no", exist = true)
    private String vehicleNo;
    /**
     * 发动机号
     */
    @TableField(value = "engine_number", exist = true)
    private String engineNumber;
    /**
     * 初登日期
     */
    @TableField(value = "first_registration_date", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate firstRegistrationDate;
    /**
     * 车辆类型:营运货车,家庭自用客车,需要有字典表
     */
    @TableField(value = "vehicle_type", exist = true)
    private String vehicleType;
    /**
     * 厂牌型号
     */
    @TableField(value = "factory_plate_model", exist = true)
    private String factoryPlateModel;
    /**
     * 营业性质:营运非营运,营业客车
     */
    @TableField(value = "vehicle_usage", exist = true)
    private String vehicleUsage;
    /**
     * 新车购置价
     */
    @TableField(value = "price", exist = true)
    private BigDecimal price;
    /**
     * 排量
     */
    @TableField(value = "displacement", exist = true)
    private Float displacement;
    /**
     * 座位数
     */
    @TableField(value = "seating", exist = true)
    private Integer seating;
    /**
     * 车主姓名
     */
    @TableField(value = "car_owner", exist = true)
    private String carOwner;
    /**
     * 机构Code
     */
    @TableField(value = "org_code", exist = true)
    private String orgCode;
    /**
     * 整备质量
     */
    @TableField(value = "curb_weight", exist = true)
    private BigDecimal curbWeight;
    /**
     * 总质量
     */
    @TableField(value = "gross_vehicle_weight", exist = true)
    private BigDecimal grossVehicleWeight;
    /**
     * 保险止期
     */
    @TableField(value = "insEndDate", exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate insEndDate;
    /**
     * 用户表ID
     */
    @TableField(value = "user_id", exist = true, updateStrategy = FieldStrategy.IGNORED)
    private Integer userId;
    /**
     * 分配人员
     */
    @TableField(value = "user_name", exist = true, updateStrategy = FieldStrategy.IGNORED)
    private String userName;
    /**
     * 备注
     */
    @TableField(value = "remark", exist = true)
    private String remark;
    /**
     * 机构编码
     */
    @TableField(value = "enterprise_id", exist = true)
    private String enterpriseId;
    /**
     * 创建时间
     */
    @TableField(value = "create_date", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;
    /**
     * 修改时间
     */
    @TableField(value = "modification_date", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime modificationDate;

    /**
     * 分配时间
     */
    @TableField(value = "allocationDate", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime allocationDate;

    /**
     * 客户跟进是否成功 1：成功  2：失败
     */
    @TableField(value = "success", exist = true, updateStrategy = FieldStrategy.IGNORED)
    private String success;

    /**
     * 交强险止期
     */
    @TableField(value = "CLIVTAEndDate", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate clivtaEndDate;


    /**
     * 商业险止期
     */
    @TableField(value = "VIEndDate", exist = true)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate viEndDate;

    @TableField(exist = false)
    private String label;

    @TableField(exist = false)
    private String clientTypeName;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastCallTime;

    /**
     * 失败原因
     */
    @TableField(value = "failureCause")
    private String failureCause;
    /**
     * 保险公司代码
     */
    @TableField(value = "insurer_code", exist = true)
    private String insurerCode;

    /**
     * 保险公司名称
     */
    @TableField(value = "insurerName", exist = false)
    private String insurerName;
}